import { C_ } from "./go_obj";

export class Hello extends Element 
{
    componentDidMount() {
        console.log("=====xxxx ==>>>")
        C_("Test2", 30, 40)
        console.log("==> out:", out)

        var out = C_("Test3", 30, 40)
        console.log("==> Test3 out:", out)

        var data_a = C_("GetDataA", 35)
        var val_a = data_a.C("GetValue")
        console.log("DataA val:", val_a)

        var message = this.attributes["message"] || "?";
        this.content([<h1>{message}</h1>,
                    <button.expand>+</button>,
                    <button.collapse>-</button>]);
  }
  ["on click at button.expand"]() {   // note: ES2020 syntax
    this.state.expanded = true;       // 'this' is the element of class Hello
  }
  ["on mouseover at h1"]() {
    this.state.expanded = true;
  }
  ["on click at button.collapse"]() { // handles click events
    this.state.collapsed = true;      // at button.collapse child
  }
}